FROM centos:8

# 安装基础命令
RUN yum install -y ncurses sudo passwd vim util-linux-user

# # 创建新用户
RUN useradd test \
&& echo 'test:test' | chpasswd \
&& echo 'test ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers

USER test:test
WORKDIR /home/test

# 安装 oneclick-setup 的运行环境
RUN sudo yum install -y ruby
RUN sudo gem install pry
RUN mkdir /home/test/.config

# 声明当前操作系统为 CentOS
RUN echo 'export PATH=~/.config/oneclick-setup:$PATH' >> ~/.bashrc
